import time,_MediaServer

MEDIA_SERVER_HOST = '127.0.0.1'
MEDIA_SERVER_PORT = 12701

SLEEP_TIME = 0.05

global mediaServer

def initialize():
        global MEDIA_SERVER_HOST,MEDIA_SERVER_PORT

	print "Starting mediaServer..."
	mediaServer = mediaServer(MEDIA_SERVER_PORT, MEDIA_SERVER_HOST);
	print ">>> mediaServer initialized <<<"

def __start():
    global SLEEP_TIME

    initialize()
    while (1):
        $mediaServer->iterate();
        time.sleep(SLEEP_TIME)

if __name__ == '__main__': __start()
